﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;

using BTN04.DTO;
using BTN04.DAO;

namespace BTN04.BUS
{
    public class NguoiDungBUS
    {
        public int KiemtraTenDangNhapDaTonTaiHayChua(string tendangnhap)
        {
          
             NguoiDungDAO ndDal = new NguoiDungDAO();
          int ma = ndDal.KiemtraTenDangNhapDaTonTaiHayChua(tendangnhap);
            return ma;
        }

       public int Dangkynguoidung(NguoiDungDTO nd)
        {
            NguoiDungDAO ndDal = new NguoiDungDAO();
            return ndDal.Dangkynguoidung(nd);
        }
       public NguoiDungDTO LayThongTinNguoiDungTheoTenDangNhap(string tendangnhap)
       {
           NguoiDungDAO ndDAO = new NguoiDungDAO();
           return ndDAO.LayThongTinNguoiDungTheoTenDangNhap(tendangnhap);
       }
       //
       public List<NguoiDungDTO> LayThongDanhSachNguoiDung()
       {
           NguoiDungDAO ndDAO = new NguoiDungDAO();
           return ndDAO.LayThongDanhSachNguoiDung();
       }
       public DataTable KiemTraDangNhap(string tendangnap, string matkhau)
       {
           NguoiDungDAO ndDAO = new NguoiDungDAO();
           return ndDAO.KiemTraDangNhap(tendangnap, matkhau);
       }
       public int UpdateMatKhau(string tendangnhap, string matkhau)
       {
           NguoiDungDAO ngDAO = new NguoiDungDAO();
           return ngDAO.UpdateMatKhau(tendangnhap, matkhau);
       }
       public int UpdateThongTinNguoiDung(NguoiDungDTO ngDTO)
       {
           NguoiDungDAO ngDAO = new NguoiDungDAO();
           return ngDAO.UpdateThongTinNguoiDung(ngDTO);
       }
    }
}
